package com.mondo.financialwallet.data.entity.mapper;

import com.mondo.financialwallet.data.entity.BasisResponseEntity;
import com.mondo.financialwallet.data.entity.MyTokenListEntity;
import com.mondo.financialwallet.data.entity.TokenAddressEntity;
import com.mondo.financialwallet.data.entity.TokenTransactionRecordEntity;
import com.mondo.financialwallet.data.entity.WalletAssetEntity;
import com.mondo.financialwallet.domain.model.Response;
import com.mondo.financialwallet.domain.model.Token;
import com.mondo.financialwallet.domain.model.TransactionRecordList;
import com.mondo.financialwallet.domain.model.WalletAsset;

import java.util.ArrayList;
import java.util.List;

public class WalletDataEntityMapper {

    public Response<List<Token>> transform(MyTokenListEntity entity) {
        String msg = entity.getMsg();
        String status = entity.getStatus();
        List<MyTokenListEntity.DataBean> data = entity.getData();

        List<Token> tokenList = new ArrayList<>();
        for (MyTokenListEntity.DataBean tokenEntity : data) {
            tokenList.add(new Token());
        }

        return new Response<>(tokenList, 1, msg);
    }

    public Response<TransactionRecordList> transform(TokenTransactionRecordEntity entity) {
        return new Response<>(new TransactionRecordList(), 1, entity.getMsg());
    }

    public Response<Token> transform(TokenAddressEntity entity) {
        return new Response<>(new Token(), 1, entity.getMsg());
    }

    public Response<WalletAsset> transform(WalletAssetEntity entity) {
        return new Response<>(new WalletAsset(), 1, entity.getMsg());
    }

    public Response<Void> transform(BasisResponseEntity entity) {
        return new Response<>(null, 1, entity.getMsg());
    }
}
